<!--
 * @FilePath     : /study_code/vue2.x/component-props1.html
 * @Description  : d1 props 简单使用
 * @Date         : 2025-05-02 16:58:06
 * @Author       : Fang YingGui
 * @LastEditors  : fangyinggui 18715384437@163.com
 * @LastEditTime : 2025-05-02 16:58:07
-->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>documentName</title>
    <link rel="stylesheet" href="" />
  </head>
  <body>
    <div id="app">
      <blog-post :title="title"></blog-post>
    </div>

    <!-- is| v-for| v-if, v-else-if, v-show, v-cloak| v-pre, v-once| id| ref,key| v-model| (html原生属性)|(动态属性)| v-on| v-html, v-text -->

    <script src="/vue/dist/vue.min.js"></script>
    <script src="./common.js"></script>
    <script>
      /*
      // 自定义组件
      const myComponent = {
        data: function () {
          return {}
        },
        props: [],
        template: ``,
        methods: {},
      }
      */

      Vue.component('blog-post', {
        props: ['title'],
        template: '<h3>{{ title }}</h3>',
      })

      // el| name, parent| functional| delimiters, comments| components, directives, filters| extends, mixins| inheritAttes, model, props/propsData| data, computed| watch| 生命周期钩子(beforeCreate, created, beforeMount, mounted, beforeUpdate, updated, activated, deactivated, beforeDestroy, destroyed)| methods| template/render, renderError

      var app = new Vue({
        el: '#app',
        // name: '',
        // props: {},
        // components: {},
        data() {
          return {
            title: '动态的博客标题',
          }
        },
        // computed: {},
        // watch: {},
        // 钩子函数
        methods: {},
      })
    </script>
  </body>
</html>
